<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Login</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        .register-button {
            display: inline-block;
            padding: 10px 20px;
            background-color: #4CAF50; /* 绿色背景 */
            color: white; /* 白色文字 */
            text-align: center;
            text-decoration: none; /* 去除下划线 */
            font-size: 16px;
            margin: 4px 2px;
            cursor: pointer;
            border-radius: 4px; /* 圆角边框 */
        }
    </style>
	<!-- 引入 Bootstrap CSS -->
	<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">

	<!-- 引入 Bootstrap JS -->
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
	    <h1 class="text-center mb-4">Login</h1>
	    <!-- 显示注册成功消息 -->
	    <div th:if="${message}" class="text-center text-success">
	        <p th:text="${message}"></p>
	    </div>
		<div th:if="${loginFaile}" class="text-center text-success">
		        <p th:text="${loginFaile}"></p>
		</div>
	    <form th:action="@{/user/login}" method="post" class="needs-validation" novalidate>
	        <div class="mb-3">
	            <label for="username" class="form-label">Username</label>
	            <input type="text" class="form-control" id="username" name="username" required>
	        </div>
	        <div class="mb-3">
	            <label for="pwd" class="form-label">Password</label>
	            <input type="password" class="form-control" id="pwd" name="pwd" required>
	        </div>
	        <div class="mb-3">
	            <button type="submit" class="btn btn-primary w-100">Submit</button>
	        </div>
	    </form>
    <!-- 添加一个跳转到注册页面的按钮 -->
    <a th:href="@{/user/register}" class="register-button">Register</a>
</body>
</html>